import { service } from '@/service'

enum Api {
  menu = 'menus'
}

export const menuList = (params?: any) => {
  return service.request({
    url: Api.menu,
    method: 'GET',
    params
  })
}

export const menuDetail = (menu: any) => {
  return service.request({
    url: Api.menu + `/${menu}`,
    method: 'GET'
  })
}

export const menuAdd = (data: any) => {
  return service.request({
    url: Api.menu,
    method: 'POST',
    data
  })
}

export const menuEdit = (menu: number, data: any) => {
  return service.request({
    url: Api.menu + `/${menu}`,
    method: 'put',
    data
  })
}

export const menuDel = (menu: any) => {
  return service.request({
    url: Api.menu + `/${menu}`,
    method: 'DELETE'
  })
}
